﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CodeFirst.Models.Mapping
{
    class GradeMap :EntityTypeConfiguration<Grade>
    {
        public GradeMap()
        {
            // Primary Key
            HasKey(t => t.Id);

            // Properties
            Property(t => t.Name)
                .IsRequired()
                .HasMaxLength(12);

            // Table & Column Mappings
            ToTable("Grades");
            Property(t => t.Id).HasColumnName("Id");

            // Relationships
           
        }
    }
}
